﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;

namespace PoemGame.Repository.EF.SqlServer
{
    public class DesignDbContextFactory : IDesignTimeDbContextFactory<PoemGameDbContext>
    {
        public PoemGameDbContext CreateDbContext(string[] args)
        {
            var optionsBuilder = new DbContextOptionsBuilder<PoemGameDbContext>();
            optionsBuilder.UseSqlServer("Server=(local);Database=MyPoemGame;uid=sa;pwd=pwd;Encrypt=False",
                x => x.MigrationsAssembly("PoemGame.Repository.EF.SqlServer"));
            return new PoemGameDbContext(optionsBuilder.Options);
        }
    }
}